<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Businesses extends Model
{
    //
    protected $table = 'businesses';

    public $timestamps = false;

    protected $fillable = ['port','throughput','type','author','create_time','update_time'];
    public function getCreatAtAttribute()
    {
        return date('Y-m-d', strtotime($this->attributes['creat_at']));
    }
    static function getData($type){
        return self::where([['type', '=', $type]])->orderBy('creat_at','desc')->limit(10)->get();
    }
}
